package com.tron.stream;

import java.math.BigInteger;
import java.util.Iterator;
import java.util.stream.Stream;

public class StreamCreate {
    public static void main(String[] args) {
        String string = "tron";
        Stream<String> splitStream = Stream.of(string.split(""));
        long count = splitStream.count();
        System.out.println(count);

        // 创建无限流
        Stream<BigInteger> integerStream = Stream.iterate(BigInteger.ZERO, i -> i.add(BigInteger.ONE));
        Iterator<BigInteger> iterator = integerStream.iterator();
        System.out.println(iterator.next());
        System.out.println(iterator.next());

    }
}
